package com.weds.data_sync.config;

import com.weds.data_sync.interceptor.LoginInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description 拦截器设置
 * @Author lihw
 * @Date 2024/1/4 14:24
 */
@Configuration
@Slf4j
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**")
                .excludePathPatterns("/api/account/v1/*", "/test/**")
                .excludePathPatterns("/v3/api-docs/**", "/doc.html**", "/webjars/**", "/swagger-resources", "/swagger-ui/**");
    }
}
